<form action="/Group/add_group" method="post" target="hidden_frame">
	<input type="hidden" name="app_id" value="{$_SESSION['apps'][0]['id']}" />
	<table border="1" width="560" class="tab">
	
		<tbody>
		<tr valign="middle" align="center">			
			<th width="91" height="35"><b>分组名称：</b></th>
			<td><input type="text" name="name" value="" id="m_title"/></td>
			<td><input type="submit" value="submit" /></td>
		</tr>       
	</tbody>
	</table>
	
	<iframe name="hidden_frame" id="hidden_frame" style="display:none"></iframe>
</form>	
	
<table class="menu_table" id="list_tab" >
<volist name="data" id="vo">
  <tr>
 		<td class="mouse_over" onmouseover="show(this)" onmouseout="hid(this)">
 			<div class="act_warp">
 				<span style="float:left;">
 					<input type="text" value='{$vo["name"]}' style="font-size:12px; padding:5px 10px;" class="menu_name" name="name" onchange="edit(this)"/>
 					<input type="hidden" value='{$vo["id"]}' />
 					({$vo['count']})
 				</span>
 				<span class="hidden_act1" style="display:none;"  onclick="delGroup(this)" >X</span>
 			</div>
 		</td>
  </tr>
 </volist>
</table>
<style type="text/css">
table {border-collapse: collapse;border-spacing: 0;}
.tab {border: 1px solid #DBDBDB;margin: 15px 0 0 7px;}
.tab th{text-align:right;}
.tab td,.tab th{border: 1px solid #DBDBDB; background:#EAEAEA; height: 35px;line-height: 35px;}
.tab td{padding-left:15px; text-align:left;}
</style>
<script type="text/javascript">
    function show(obj){
    	oSpan = obj.children[0].children[1];
    	//var oSpan = document.getElementById("del");
    	oSpan.style.display="block";
    	obj.style.background="#cccccc";	
    }
    function hid(obj){
    	oSpan = obj.children[0].children[1];
    	//var oSpan = document.getElementById("del");
    	oSpan.style.display="none";	
    	obj.style.background="white";
    }
    
    function edit(obj){
    	if(obj.nextSibling.nodeType == 1){
    		var id = oInput=obj.nextSibling.value;
    	}else{
    		var id = oInput=obj.nextSibling.nextSibling.value;
    	}
    	
    	ajax_submit("/Group/edit_group","id="+id+"&name="+obj.value);
    	
    	
    }
    
	function delGroup(obj){
		if(confirm("Realy want to delete ?")){
			var id= obj.parentNode.children[0].children[1].value;
	    	ajax_submit("/Group/del_group","id="+id)			
		}

		
	}
</script>